#!/usr/bin/expect -f
set IP [lrange $argv 0 0]
set USERNAME [lrange $argv 1 1]
set PASSWORD [lrange $argv 2 2]
spawn telnet $IP
expect -re "login: "
send "$USERNAME\n"
expect -re "Password: "
send "$PASSWORD\n"
interact
